﻿<script>
  highlight_subnav('goodslist');
</script>
<style>
	th{
		white-space: nowrap;
	}
</style>
 <!-- 内容区域 -->
 <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-cf">商品列表</div>

                            </div>
                            <div class="widget-body  am-fr">

                                <div class="am-u-sm-6 am-u-md-6 am-u-lg-6">
                                    <div class="am-form-group">
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a href="<?php echo $base_url;?>admin/goods/createHtml" class="am-btn am-btn-default am-btn-success" ><span class="am-icon-plus"></span> 新增</a>
                                                
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <form action="index" method="get" id="form">

                                <div class="am-u-sm-6 am-u-md-6 am-u-lg-3">

                                    <div class="am-form-group tpl-table-list-select">
                                        <select data-am-selected="{btnSize: 'sm'}" name="activity_id" id='activity_id'>
							              <option value="0" >活动类型</option>
							             <?php foreach($activity as $key => $value){?>
                                              <option value="<?php echo $value['activity_id']?>" <?php if(isset($_GET['activity_id'])){if($_GET['activity_id'] == $value['activity_id']){echo "selected";}}?>><?php echo $value['activity_name']?></option>
                                              <?php }?>
							            </select>
                                    </div>
                                </div>

                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" name="goods_name" value="<?php if(isset($_GET['goods_name'])){echo $_GET['goods_name'];}?>" placeholder="输入商品名搜索" class="am-form-field ">
                                        <span class="am-input-group-btn">
            								<input class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="submit" value="搜索">
         								</span>
                                    </div>
                                </div>
                                </form>
                                <div class="am-u-sm-12">
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                                        <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>商品缩略图</th>
                                                <th>商品名称</th>
                                                <th>价钱</th>
                                                <th>状态</th>
                                                <th>时间</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <?php 
                                        	$count = count($info);
                                        	for($i=0;$i<$count;$i++){ 
                                        ?>
                                            <tr class="gradeX">
                                                <td><?php echo $i+1;?></td>
                                                <td>
                                                    <img src="<?php if(!empty($info[$i]['img_path'])){echo $base_path.$info[$i]['img_path'];}?>" class="tpl-table-line-img" alt="">
                                                </td>
                                                <td class="am-text-middle"><?php if(!empty($info[$i]['name'])){echo $info[$i]['name'];}?></td>
                                                <td class="am-text-middle"><?php if(!empty($info[$i]['price'])){echo $info[$i]['price'];}?></td>
                                                <td class="am-text-middle"><?php if(!empty($info[$i]['status'])){if($info[$i]['status'] == 2){echo "已上线";}else{echo "已下线";}}?></td>
                                                <td class="am-text-middle"><?php if(!empty($info[$i]['update_time'])){echo date("Y-m-d H:i:s",$info[$i]['update_time']);}?></td>
                                                <td class="am-text-middle">
                                                    <div class="tpl-table-black-operation">
                                                        <a href="<?php echo $base_url;?>admin/goods/createHtml?goods_id=<?php echo $info[$i]['goods_id'];?>">
                                                            <i class="am-icon-pencil"></i> 编辑
                                                        </a>
                                                        <!-- <a href="javascript:;" class="tpl-table-black-operation-del">
                                                            <i class="am-icon-trash"></i> 删除
                                                        </a> -->
                                                    </div>
                                                </td>
                                            </tr>
                                            <?php }?>
                                            <!-- more data -->
                                        </tbody>
                                    </table>
                                </div>
                                <div class="am-u-lg-12 am-cf" style="display:none">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">3</a></li>
                                            <li><a href="#">4</a></li>
                                            <li><a href="#">5</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


</body>

</html>
<script type="text/javascript">
$('#activity_id').change(function(){
        $('form').submit();  
})
</script>

       
